<?php

namespace Account\Model\Entity;

class Person {

    protected $id;
    protected $department;
    protected $firstname;
	protected $jobtitle;
	protected $lastname;
	protected $mobilephone;
	protected $officephone;
	protected $officefax;
	protected $ownedsecurable_id;
	protected $primaryaddress_address_id;
	protected $primaryemail_email_id;
	protected $title_customfield_id;
	
	public function exchangeArray($data)
    {
        $this->id     = (isset($data['id'])) ? $data['id'] : null;
        $this->department = (isset($data['department'])) ? $data['department'] : null;
        $this->firstname  = (isset($data['description'])) ? $data['description'] : null;
		$this->jobtitle  = (isset($data['employees'])) ? $data['employees'] : null;
		$this->lastname  = (isset($data['lastestactivitydatetime'])) ? $data['latestactivitydatetime'] : null;
		$this->mobilephone  = (isset($data['name'])) ? $data['name'] : null;
		$this->officephone  = (isset($data['officephone'])) ? $data['officephone'] : null;
		$this->officefax  = (isset($data['officefax'])) ? $data['officefax'] : null;
		$this->ownedsecurableitem_id  = (isset($data['ownedsecurableitem_id'])) ? $data['ownedsecurableitem_id'] : null;
		$this->primaryaddress_address_id  = (isset($data['billingaddress_address_id'])) ? $data['billingaddress_address_id'] : null;
		$this->primaryemail_email_id  = (isset($data['primaryemail_email_id'])) ? $data['primaryemail_email_id'] : null;
		$this->title_customfield_id  = (isset($data['type_customfield_id'])) ? $data['type_customfield_id'] : null;		
    }
	
    public function __construct(array $options = null) {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }
/*
    public function __set($name, $value) {
        $method = 'set' . $name;
        if (!method_exists($this, $method)) {
            throw new Exception('Invalid Method');
        }
        $this->$method($value);
    }

    public function __get($name) {
        $method = 'get' . $name;
        if (!method_exists($this, $method)) {
            throw new Exception('Invalid Method');
        }
        return $this->$method();
    }

    public function setOptions(array $options) {
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        
        return $this;
    }
*/
    public function getId() {
        return $this->id;
    }

    public function setId($id) {
        $this->id = $id;
        return $this;
    }

    public function getDepartment() {
        return $this->department;
    }

    public function setDepartment($department) {
        $this->department = $department;
        return $this;
    }

    public function getFirstname() {
        return $this->firstname;
    }

    public function setFirstname($firstname) {
        $this->firstname = $firstname;
        return $this;
    }
	
    public function getJobtitle() {
        return $this->jobtitle;
    }

    public function setJobtitle($jobtitle) {
        $this->jobtitle = $jobtitle;
        return $this;
    }
	
    public function getLastname() {
        return $this->lastname;
    }

    public function setLastname($lastname) {
        $this->lastname = $lastname;
        return $this;
    }
	
    public function getMobilephone() {
        return $this->mobilephone;
    }

    public function setMobilephone($mobilephone) {
        $this->mobilephone = $mobilephone;
        return $this;
    }
	
    public function getOfficePhone() {
        return $this->officephone;
    }

    public function setOfficePhone($officephone) {
        $this->officephone = $officephone;
        return $this;
    }
	
    public function getOfficeFax() {
        return $this->officefax;
    }

    public function setOfficeFax($officefax) {
        $this->officefax = $officefax;
        return $this;
    }
	
	 public function getOwnedSecurable_Id() {
        return $this->ownedsecurable_id;
    }

    public function setOwnedSecurable_Id($ownedsecurable_id) {
        $this->ownedsecurable_id = $ownedsecurable_id;
        return $this;
    }
	
	public function setPrimaryaddress_Address_Id($primaryaddress_address_id) {
        $this->primaryaddress_address_id = $primaryaddress_address_id;
        return $this;
    }
	
	
	public function getPrimaryEmail_Email_Id() {
        return $this->primaryemail_email_id;
    }

    public function setPrimaryEmail_Email_Id($primaryemail_email_id) {
        $this->primaryemail_email_id = $primaryemail_email_id;
        return $this;
    }
	
	public function getTitle_Customfield_Id() {
        return $this->title_customfield_id;
    }

    public function setTitle_Customfield_Id($title_customfield_id) {
        $this->title_customfield_id = $title_customfield_id;
        return $this;
    }	
}
?>